{include file="common/header"/}
<div class="lemo-container">
    <div class="lemo-main">
        <fieldset class="layui-elem-field layui-field-title">
            <legend>每日订单</legend>


            <blockquote class=" layui-elem-quote">
                <div class="layui-form layui-input-inline">
                    <input type="text" class="layui-input" id="date" placeholder="请选择时间">
                  </div>

                  <button class="layui-btn data-add-btn layui-btn-sm" lay-submit="" lay-filter="search" id="search_by_date">搜索</button>
                <!-- <div class="layui-form layui-row layui-col-space16"> -->
                    
                    <!-- <label class="layui-form-label">关键字</label> -->

                        
                        <!-- <div class="layui-inline">
                            <input type="text" name="keywords" id="keywords" placeholder="请输入关键字" autocomplete="off" class="layui-input">

                        </div>
                        <button class="layui-btn data-add-btn layui-btn-sm" lay-submit="" lay-filter="search" id="find">搜索</button> -->

                    

                        <!-- <div class="layui-col-md1 layui-inline">
                            <select  name="platform"  id="platform"  >
                                <option value="">请选择媒体</option>
                                <option value="dy_juliang">巨量</option>
                                <option value="ks_dsp">快手</option>
                                <option value="tracking_e_qq">腾讯</option>
                            </select>
                          </div> -->
<!-- 
                          <div class="layui-col-md1 layui-inline"">
                            <select  name="shop"  id="shop"  >
                                <option value="">请选择平台</option>
                                <option value="pdd">拼多多</option>
                                <option value="jd">京东</option>
                                <option value="tb">淘宝</option>
                            </select>
                          </div>            -->
                <!-- </div> -->

            </blockquote>

        </fieldset>

        <table class="layui-table" id="list" lay-filter="list"></table>
    </div>
</div>
{include file="common/footer"/}

<script type="text/html" id="platform1">
    {{# if (d.platform == 'dy_juliang') {}}
    巨量
    {{# } else if (d.platform == 'ks_dsp') {}}
    快手
    {{# } else if (d.platform == 'tracking_e_qq') {}}
    腾讯
    {{# } else {}}
 
    {{# }}}
</script>

<script type="text/html" id="shop1">
    {{# if (d.shop == 'pdd') {}}
    拼多多
    {{# } else if (d.shop == 'jd') {}}
    京东
    {{# } else if (d.shop == 'tb') {}}
    淘宝
    {{# } else {}}
 
    {{# }}}
</script>

<script type="text/html" id="is_callback">
    {{# if (d.is_callback == 0) {}}
    未回传
    {{# } else if (d.is_callback == 1) {}}
    已回传
    {{# } else {}}
    {{# }}}
</script>
<script type="text/html" id="status">
    {{# if(d.order_status==1){ }}
    已下单
    {{# } else if (d.order_status == 2) {}}
    已支付
    {{# } else if (d.order_status == 3) {}}
    已确认收获
    {{# } else if (d.order_status == 4) {}}
    已取消
    {{# } else if (d.order_status == 5) {}}
    已结算
    {{# }else{  }}
    
    {{# } }}
</script>

<script type="text/html" id="add_time">
    {{layui.util.toDateString(d.order_time*1000, 'yyyy-MM-dd HH:mm:ss')}}
</script>
<script>
    var tableIn;
    layui.config({
        base: "/static/admin/js/",
        version: true
    }).extend({
        Admin: 'Admin'
    }).use(['element', 'layer', 'Admin', 'laydate'], function () {
        var $ = layui.jquery,
            form = layui.form,
            laydate = layui.laydate,
            table = layui.table;
            table.on('toolbar(list)', function(obj){
                if(obj.event === 'page_size'){
                    table.reload('list', {
                    where: {
                        page_size: obj.config.limit // 获取当前分页容量
                    }
                    });
                }
            });
            laydate.render({
                elem: '#date'
            });
        tableIn = table.render({
            elem: '#list',
            url: '{:url("orderList")}',
            method:'post',
            title:'{:lang("admin")}{:lang("list")}',
            cols: [[
                {field:'order_num', title: '订单ID', width:210,fixed: true}
                // ,{field:'platform', title: '媒体', width:100, templet: "#platform1"}
                ,{field:'item_name', title: '商品名称', width:420}
                ,{field:'pro_num', title: '数量', width:60}
                ,{field:'order_time', title: '创建订单时间', width:180, templet: "#add_time"}
                ,{field:'order_price', title: '实付金额',width:100}
                ,{field:'ad_name', title: '计划名称',width:100}
                ,{field:'mall_name', title: '店铺名称',width:150}
                // ,{field:'is_limit', title: '是否限制推广',width:100, templet: '#is_limit'}
                ,{field:'order_status', title: '订单状态',width:150, templet: '#status'}
                ,{field:'refund_price', title: '退款金额',width:150}
                ,{field:'is_callback', title: '是否回传',width:150, templet: '#is_callback'}
            ]],
            limits: [10, 15, 20, 25, 50, 100],
            limit: 20,
            page: true,
            request: {
                limitName: 'page_size', // 将默认的limit参数改为page_size
                pageName: 'page',
            }
        });

    });
</script>
